package com.ssm.reader.utils;

import org.apache.commons.codec.digest.DigestUtils;

/*
 *MD5工具类
 *
 *@data 2022-05-01
 */
public class MD5Utils {
    public static String md5Digest(String source,Integer salt){
        char[] ca = source.toCharArray();
        for (int i = 0; i < ca.length; i++) {
            //  为原始字符串每一个字符进行加盐
            ca[i] = (char) (ca[i] + salt);
        }
        String target = new String(ca);
        String md5 = DigestUtils.md5Hex(target);
        return md5;

    }
}
